<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page isELIgnored ="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>列表</title>
    <link rel="stylesheet" href="${basePath}style.css">
    <link rel="stylesheet" href="${basePath}font-awesome-4.7.0/css/font-awesome.min.css">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function(){
            $('.remove').click(function(){
                if(confirm("确定要删除吗？")){
                    window.location.href="${basePath}student?method=delete&id="+$(this).attr("keyword");
                }
            })
        })
    </script>
    </head>
<body>
<form action="${basePath}student?method=list" method="post">
    <div class="condition">
        ID：<input type="text" name="studentId">
        姓名：<input type="text" name="stuName">
        学号：<input type="text" name="stuNum">
        <button>
            <i class="fa fa-search"></i>
            查询
        </button>
        <button type="button" onclick="window.location.href='student/add.jsp'">
            <i class="fa fa-plus"></i>
            新增
        </button>
    </div>
</form>
<form action="${basePath}student?method=list" id="tableList" method="post">
    <input type="hidden" name="pageNo" value="${pageInfo.pageNo}">
    <input type="hidden" name="studentId" value="${student.studentId}">
    <input type="hidden" name="stuName" value="${student.stuName}">
    <input type="hidden" name="stuNum" value="${student.stuNum}">
    <table class="tablelist">
        <thead>
            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>学号</th>
                <th width="160px">操作</th>
            </tr>
        </thead>

        <c:forEach  items="${pageInfo.list}" var="student">
        <tr>
            <td>${student.studentId}</td>
            <td>${student.stuName}</td>
            <td>${student.stuNum}</td>
            <td>
                <button class="edit" type="button" onclick="window.location.href='${basePath}student?method=edit&id=${student.studentId}'">
                    <i class="fa fa-edit"></i>
                    修改
                </button>
                <button class="remove" type="button" keyword="${student.studentId}">
                    <i class="fa fa-remove"></i>
                    删除
                </button>
            </td>
        </tr>
        </c:forEach>
    </table>
<%@include file="../page.jsp"%>
</form>
</body>


</html>